package cn.cqie.attendance.common.controller;

import cn.afterturn.easypoi.cache.HtmlCache;
import cn.cqie.attendance.common.pojo.Select;
import cn.cqie.attendance.common.service.SelectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@RestController
@Api(tags = "公共查询接口")
public class SelectController {

    @Autowired
    private SelectService selectService;

    @Autowired
    private HttpServletRequest request;

    @GetMapping("/queryAllCollege")
    @ApiOperation("查询所有学院")
    public List<Select> queryAllCollege() {
        return selectService.queryAllCollege();
    }

    @GetMapping("/queryAllMajor")
    @ApiOperation("查询所有专业")
    public List<Select> queryAllMajor() {
        return selectService.queryAllMajor();
    }

    @GetMapping("/queryAllGroup")
    @ApiOperation("查询所有小组")
    public List<Select> queryAllGroup() {
        return selectService.queryAllGroup();
    }


    @GetMapping("/queryAllClass")
    @ApiOperation("查询所有班级")
    public List<Select> queryAllClass() {
        return selectService.queryAllClass();
    }

    @GetMapping("/queryAllApprover")
    @ApiOperation("查询所有审批人")
    public List<Select> queryAllApprover() {
        return selectService.queryAllApprover();
    }

    @GetMapping("/queryAllCourse")
    @ApiOperation("查询所有课程")
    public List<Select> queryAllCourse() {
        return selectService.queryAllCourse();
    }

    @GetMapping("/queryAllCourseStatus")
    @ApiOperation("查询所有交付的项目")
    public List<Select> queryAllGroupStatus(){
        return selectService.queryAllCourseStatus();
    }


    @GetMapping("/queryAllTrainTeacher")
    @ApiOperation("查询所有实训老师")
    public List<Select> queryAllTrainTeacher() {
        return selectService.queryAllTrainTeacher();
    }

    @GetMapping("/queryAllGrade")
    @ApiOperation("查询所有年级")
    public List<Select> queryAllGrade() {
        return selectService.queryAllGrade();
    }

    @GetMapping("/queryCourseByTeacher")
    @ApiOperation("查询老师下的课程")
    public List<Select> queryCourseByTeacher() {
        return selectService.queryCourseByTeacher(request);
    }

    @GetMapping("/queryGroupByTeacher")
    @ApiOperation("查询老师下的课程的小组")
    public List<Select> queryGroupByTeacher() {
        return selectService.queryGroupByTeacher(request);
    }

    @GetMapping("/queryAllResponseTeacher")
    @ApiOperation("查询所有责任老师")
    public List<Select> queryAllResponseTeacher() {
        return selectService.queryAllResponseTeacher();
    }
}
